package com.bw.mapper;

import com.bw.domain.*;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author :Beyond🎸🎸
 * @date : 2025-03-08 11:08:14
 * @description Rock and Roll
 **/
@Mapper
public interface OrderMapper {

    List<Order> list(Order order);

    @Select("select id,community_name,id value,community_name name from t_community")
    List<Community> listCommunity();

    void update(Order order);

    void addOrderDetail(@Param("orderId") Integer orderId, @Param("worker") String worker);

    @Select("select * from t_order_detail where order_id = #{orderId}")
    List<Orderdetail> listDetailByOrderId(String orderId);

    Order get(String orderId);

    List<Orderdetail> getOrderDetail(String orderId);

    @Insert("insert into t_rate(order_id,username,content,create_time) values(#{orderId},#{username},#{content},now())")
    int rate(Rate rate);

    List<Rate> ListRate(String orderId);

    @Select("select * from t_dict where type = #{type}")
    List<Dict> listType(String type);

    int add(Order order);

    List<Order> listByIds(@Param("ids") String ids);
}
